#include "Stdafx.h"
#include "FT2_Obj.h"
#include "QuestionCharacter.h"
#include "DrawingManager.h"

class GameManager
{
public:
	GameManager(Ogre::SceneManager* _mSceneMgr, Ogre::Camera* _mCamera, int _useStroke){
		mSceneMgr = _mSceneMgr;
		mCamera = _mCamera;
		textSize = Ogre::Vector2(0.06,0.06);
		detectRadiusRatio = 1.2;
		dm = new DrawingManager(mSceneMgr, mCamera, useStroke);
		useStroke = _useStroke;
	};
	~GameManager(){};
	void addCharacter(wchar_t charc, float x, float y);
	void addCharacter(wchar_t charc, float x, float y, int characterType);
	void readStringFromFile();
	void startQuestion(int questionNum);
	void destroyCharacters();
	QuestionCharacter* findCharacterID(int charID);
	bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	bool update(float timeSinceLastFrame, Ogre::Vector2 mousePosition, int _useStroke);
	void goDrawStage();
	void clearAllBrush();
	std::vector<wchar_t> wQ[50];
	std::vector<wchar_t> wS[50];
	std::vector<wchar_t> wA[50];
	std::vector<wchar_t> wAllAnswerWords;
	std::vector<int> wIgnore;
	std::vector<int> wI[50];
	std::vector<QuestionCharacter*> questionWords;
	std::vector<QuestionCharacter*> staticWords;
	std::vector<QuestionCharacter*> answerWords;
	std::vector<unsigned char*> textIMs;

	Ogre::Vector2 textSize;
	int questionTotal;
	int gameState;
	int drawingBackground;
	enum {MAIN_MENU, INIT_GAME, PLAYING, SELECTING_BACKGROUND, DRAWING}; 
	DrawingManager* dm;
	Ogre::String backgroundMusicPath;
	float detectRadiusRatio;
	int useStroke;
protected:
private:
	Ogre::Viewport *mCamView;
	Ogre::SceneManager* mSceneMgr;
	Ogre::Camera* mCamera;
	

	FT2_Obj ft2;
	enum {INPUT_QUESTION_WORD, INPUT_ANSWER_WORD, INPUT_IGNORE_WORD, INPUT_IGNORE_CHARACTOR, INPUT_QUESTION_NUMS, INPUT_QUESTION_TITLE, INPUT_MUSIC_PATH}; 
	enum {QUESTION_CHARACTER, ANSWER_CHARACTER, STATIC_CHARACTER}; 
};
